package com.f2prateek.rx.preferences3;

import io.reactivex.rxjava3.annotations.NonNull;
import ohos.data.preferences.Preferences;

final class FloatAdapter implements RealPreference.Adapter<Float> {
    static final FloatAdapter INSTANCE = new FloatAdapter();

    @NonNull
    @Override
    public Float get(@NonNull String key, @NonNull Preferences preferences,
                     @NonNull Float defaultValue) {
        return preferences.getFloat(key, defaultValue);
    }

    @Override
    public void set(@NonNull String key, @NonNull Float value,
                    @NonNull Preferences editor) {
        editor.putFloat(key, value);
    }
}
